#ifndef __SCNS_KEY_H__
#define __SCNS_KEY_H__

#include "ScnsConfig.h"

#if defined(SCNS_KEY_ENABLE)&&SCNS_KEY_ENABLE==1

#include "ScnsBspKey.h"

#include "ScnsYing.h"

typedef enum
{
    SCNS_KEY_PRESS_DOWN=0,
    SCNS_KEY_PRESS_UP=1,
    
    SCNS_KEY_PRESS_HOLD,
    SCNS_KEY_PRESS_HOLD_DOWN,
}ScnsKeyPress;

typedef struct
{
    ScnsKeyEnum key;
    ScnsKeyPress status;
}ScnsKeyMsg;

typedef enum
{
    SCNS_KEY_STATUS_OK=SCNS_YING_STATUS_OK,
    SCNS_KEY_STATUS_BEP_FAILED=SCNS_YING_STATUS_BSP_FAILED,
    SCNS_KEY_STATUS_FAILED=SCNS_YING_STATUS_FAILED,
    SCNS_KEY_STATUS_EMPTY
}ScnsKeyStatus;

extern ScnsKeyStatus scnsKeyInit(void);
extern void scnsKeyMsgFifoPush(ScnsKeyMsg keyMsg);
extern void scnsKeyCallback(void);
extern void scnsKeyStatusMachine(uint8*data,uint8 isDown,uint8 dt,uint8 ht,uint8 hdt,ScnsKeyEnum keyN);
#if defined(SCNS_LCD_ENABLE)&&SCNS_LCD_ENABLE==1

#include "ScnsLcd.h"

extern uint8 scnsKeyNeedDisplay(void);
extern Point scnsKeyDisplay(ScnsLcdLayer layN,Point plu,const ScnsLcdFont*font,ScnsLcdColor color,ScnsLcdColor bgColor);
#endif

#endif
#endif
